home *** CD-ROM | disk | FTP | other *** search
- /* Use a project file with this program and EGAVGA.OBJ
- * in it. Use BGIOBJ to convert EGAVGA.BGI to EGAVGA.OBJ
- * before linking the program.
- */
-
- #include <stdio.h>
- #include <graphics.h>
- #include <alloc.h>
-
- main()
- {
- int errorcode;
- int graphdriver = DETECT;
- int graphmode;
- /* Register the linked in driver EGAVGA */
- if(registerbgidriver(EGAVGA_driver) < 0)
- {
- printf("Driver could not be registered!\n");
- exit(0);
- }
- /* Detect and initialize graphics system */
- initgraph(&graphdriver, &graphmode, NULL);
- errorcode = graphresult();
- if (errorcode != gr0k)
- {
- printf("Graphics error: %s\n",
- grapherrormsg(errorcode));
- exit(1);
- };
- settext justify(CENTER_TEXT, CENTER_TEXT);
- settextstyle(SANS_SERIF_FONT, HORIZ_DIR, 1);
- outtextxy( getmaxx() /2, getmaxy() /2,
- "This program uses a linked-in driver: EGAVGA");
-
- outtextxy(getmaxx()/2, getmaxy() - 50,
- "Press any key to exit:");
- getch(); /* Wait until a key is pressed */
- closegraph; /* Exit graphics library */
- }